﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Dry.Templates
{
    public class Common
    {
        public static string GetCommon()
        {
            StringBuilder strBase = new StringBuilder();

            strBase.Append(@"
using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Practices.EnterpriseLibrary.Data;
using System.Data.SqlClient;
using System.Data;

namespace ¤ProjectName¤
{   
    public class Common
    {
        public static string GetWebConfigKey(string strKey)
        {
            return ConfigurationManager.AppSettings[strKey];
        }

        public static class ByteUtility
        {
            public static byte[] ByteArray
            {
                get;
                set;
            }

            public static bool IsEqual(byte[] compareByteArray)
            {

                if (ByteArray.Length != compareByteArray.Length)
                {

                    return false;
                }

                for (int index = 0; index < ByteArray.Length; index++)
                {

                    if (ByteArray[index] != compareByteArray[index])
                    {

                        return false;
                    }
                }

                return true;
            }
        }
    }
}
");

            return strBase.ToString();
        }
    }
}
